]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Move FolderView near FolderIcon for better context
authorCarlos Soriano <carlos.soriano89@gmail.com>
Tue, 20 Aug 2013 08:49:02 +0000 (10:49 +0200)
committerCarlos Soriano <carlos.soriano89@gmail.com>
Mon, 2 Sep 2013 16:57:36 +0000 (18:57 +0200)
Since FolderView is closely related with FolderIcon, we
have more context while working if FolderView is near
FolderIcon

https://bugzilla.gnome.org/show_bug.cgi?id=706081

js/ui/appDisplay.js

index 2e2fc27e236be1466e4edf532eb3f973ea991d8e..77898c5267aceb7428bfcc317e3cdd80445c73e2 100644 (file)
@@ -141,51 +141,6 @@ const AlphabeticalView = new Lang.Class({
 });
 Signals.addSignalMethods(AlphabeticalView.prototype);
 
-const FolderView = new Lang.Class({
-    Name: 'FolderView',
-    Extends: AlphabeticalView,
-
-    _init: function() {
-        this.parent();
-        this.actor = this._grid.actor;
-    },
-
-    _getItemId: function(item) {
-        return item.get_id();
-    },
-
-    _createItemIcon: function(item) {
-        return new AppIcon(item);
-    },
-
-    _compareItems: function(a, b) {
-        return a.compare_by_name(b);
-    },
-
-    addApp: function(app) {
-        this._addItem(app);
-    },
-
-    createFolderIcon: function(size) {
-        let icon = new St.Widget({ layout_manager: new Clutter.BinLayout(),
-                                   style_class: 'app-folder-icon',
-                                   width: size, height: size });
-        let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size);
-
-        let aligns = [ Clutter.ActorAlign.START, Clutter.ActorAlign.END ];
-        for (let i = 0; i < Math.min(this._allItems.length, 4); i++) {
-            let texture = this._allItems[i].create_icon_texture(subSize);
-            let bin = new St.Bin({ child: texture,
-                                   x_expand: true, y_expand: true });
-            bin.set_x_align(aligns[i % 2]);
-            bin.set_y_align(aligns[Math.floor(i / 2)]);
-            icon.add_actor(bin);
-        }
-
-        return icon;
-    }
-});
-
 const AllViewLayout = new Lang.Class({
     Name: 'AllViewLayout',
     Extends: Clutter.BinLayout,
@@ -603,6 +558,51 @@ const AppSearchProvider = new Lang.Class({
     }
 });
 
+const FolderView = new Lang.Class({
+    Name: 'FolderView',
+    Extends: AlphabeticalView,
+
+    _init: function() {
+        this.parent();
+        this.actor = this._grid.actor;
+    },
+
+    _getItemId: function(item) {
+        return item.get_id();
+    },
+
+    _createItemIcon: function(item) {
+        return new AppIcon(item);
+    },
+
+    _compareItems: function(a, b) {
+        return a.compare_by_name(b);
+    },
+
+    addApp: function(app) {
+        this._addItem(app);
+    },
+
+    createFolderIcon: function(size) {
+        let icon = new St.Widget({ layout_manager: new Clutter.BinLayout(),
+                                   style_class: 'app-folder-icon',
+                                   width: size, height: size });
+        let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size);
+
+        let aligns = [ Clutter.ActorAlign.START, Clutter.ActorAlign.END ];
+        for (let i = 0; i < Math.min(this._allItems.length, 4); i++) {
+            let texture = this._allItems[i].create_icon_texture(subSize);
+            let bin = new St.Bin({ child: texture,
+                                   x_expand: true, y_expand: true });
+            bin.set_x_align(aligns[i % 2]);
+            bin.set_y_align(aligns[Math.floor(i / 2)]);
+            icon.add_actor(bin);
+        }
+
+        return icon;
+    }
+});
+
 const FolderIcon = new Lang.Class({
     Name: 'FolderIcon',